<template>
  <div class="user">
    <div class="user-header">
      <div class="header-content">
        <div class="logo">
          <img src="@/assets/logo.png" alt="" />
        </div>
        <div class="tab">
          <div @click="goDetail(2)">购物中心</div>
          <div
            style="border-right: 1px solid #ccc; padding-right: 20px"
            @click="goDetail(1)"
          >
            个人中心
          </div>
          <div class="user-name">用户名</div>
        </div>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
function goDetail(type) {
  if (type == 1) {
    router.push("/user/personal");
  } else if (type == 2) {
    router.push("/user/shopping");
  }
}
</script>
<style lang="less">
.user {
  background: #f1f1f1;
  min-height: 935px;
  .user-header {
    background: #fff;
    .header-content {
      width: 1200px;
      height: 56px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .logo {
        width: 160px;
        height: 28px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .tab {
        display: flex;
        align-items: center;
        margin-left: 100px;
        div {
          margin-right: 30px;
          font-weight: 600;
          cursor: pointer;
          font-size: 16px;
          color: #666;
          position: relative;
          cursor: pointer;
          line-height: 44px;
        }
        div:hover {
          color: #53a8ff;
        }
      }
    }
  }
}
</style>
